<?php if($this->errMsg) :?>
	<?php $this->showError($this->errMsg)?>
<?php endif;?>
<script>
$(function() {
	var dates = $( "#fromday, #today" ).datepicker({
		defaultDate: "+1w",
		changeMonth: true,
		numberOfMonths: 3,
		onSelect: function( selectedDate ) {
			var option = this.id == "fromday" ? "minDate" : "maxDate",
				instance = $( this ).data( "datepicker" ),
				date = $.datepicker.parseDate(
					instance.settings.dateFormat ||
					$.datepicker._defaults.dateFormat,
					selectedDate, instance.settings );
			dates.not( this ).datepicker( "option", option, date );
		}
	});
});
</script>

<div class="mydiv">
<form name='form' id='form' action="" method="POST">
	<div class="title_ad"><label><a href="">Danh sách lược sử</a></label>
	</div>
	<div class="div_button" >	
	<table>
		<tr>
			<td><label>From day :</label></td><td><input readonly="readonly" type="text" value="<?php echo $this->from;?>" name="fromday" id="fromday" ></td>
			<td><label>To day :</label></td><td><input readonly="readonly" type="text" value="<?php echo $this->to;?>" name="today" id="today"></td>
			<td><input type="submit" value="Tìm kiếm" class="button1"/></td>
		</tr>
	</table>
	</div>
</form>
	<table  class="display" id="list">
	<thead>
		<tr>
			<th>Stt</th>
			<th>Date(Y-m-d)</th>
			<th>UserName</th>			
			<th>Action</th>
			<th>Note</th>
		</tr>
	</thead>
	<tbody>
	
	<?php
		$count = count($this->data);
		foreach($this->data as $row)
		{
	?>
		<tr>
			<td><?php echo $count?></td>
			<td><?php echo $row->date;?></td>			
			<td><?php echo $row->name;?></td>
			<td><?php echo $row->action;?></td>	
			<td><?php echo $row->note;?></td>
		</tr>		
	<?php
	$count--;
		} 		
	?>
	</tbody> 
</table>
</div>

